﻿// See https://aka.ms/new-console-template for more information
using Excel2CS;
using System.IO;

Console.WriteLine("Excel2CS");
#if DEBUG
//*
//for test
string excelPath = "./Excel";
string csPath = "./OutputCS";
//*/
#else
//*
if (args.Length != 2)
{
    Console.WriteLine("请传入两个参数：Excel所在文件夹路径 要导出的CS文件夹路径");
    //var aa = Console.ReadLine();
    //Console.WriteLine(aa + " hello!");
    return;
}
string excelPath = args[0];
string csPath = args[1];
//*/
#endif

string[] files = Directory.GetFiles(excelPath, "*.xlsx", SearchOption.TopDirectoryOnly);
var fs = files.Where(s => !s.Contains("~$")); //excel临时文件，需要过滤掉

foreach (var file in fs)
{
    Console.WriteLine(file);
    ExcelReader.Read(file, csPath);
}
